package com.itheima.d4_byte_stream;

import java.io.*;

public class FileInputStreamTest3 {
    public static void main(String[] args) throws IOException {
        InputStream is=new FileInputStream("C:\\Users\\dell\\IdeaProjects\\file-io-app\\src\\itheima03.txt");

        //准备一个字节数组，大小和文件一样，（一口气全部读出来）
        /*File f=new File("C:\\Users\\dell\\IdeaProjects\\file-io-app\\src\\itheima03.txt");
        long size=f.length();
        byte [] buffer=new byte[(int) size];

        int len=is.read(buffer);
        System.out.println(new String(buffer));

        System.out.println(size);
        System.out.println(len);*/

        byte[] buffer = is.readAllBytes();
        System.out.println(new String(buffer));

    }
}
